package com.hec.yygh.hosp.controller;

import com.hec.yygh.common.result.R;
import com.hec.yygh.hosp.service.DepartmentService;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    /**
     * 根据医院编号查询该医院下面的所有科室信息
     * 返回数据：大科室嵌套子科室
     * @return
     */
    @GetMapping("/getDeptList/{hoscode}")
    public R getAllDepartments(@PathVariable("hoscode")String hoscode){
        return departmentService.getAllDepartments(hoscode);
    }

}
